<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

function admin_url() {
	return  base_url() . "admin/";
}

function soft_url($soft, $catCode = '') {
	return base_url().strtolower($catCode).'/'.strtolower($soft->SOFT_CODE).'-'.$soft->SOFT_ID.'.html';

}

function cate_url($cate, $page = 0) {
	if($page >0)
	return base_url().strtolower($cate->CAT_CODE).'/trang-'.$page.'.html';
	return base_url().strtolower($cate->CAT_CODE).'.html';
	
}

function man_url($man, $page = 0) {
	return base_url().'publisher/'.strtolower($man->MAN_CODE).'.html';

}

function download_url($soft) {
	return base_url().'download/'.strtolower($soft->SOFT_CODE).'-'.$soft->SOFT_ID.'.html';
}

function image_src($patch = '') {
	if(strpos($patch,'ttp://'))
		return $patch;
	return base_url().$patch;

}

function redirect_url($link_code = '',$link_id) {
	return base_url().'redirect/'.strtolower($link_code).'-'.link_id.'.html';
}
function page404() {
	return base_url().'404.html';
}


?>